/**
 * 
 */
package com.boot.springBoot.entity;

import java.util.ArrayList;
import java.util.List;

import org.apache.poi.ss.formula.functions.T;

import lombok.Data;
import org.springframework.context.annotation.Bean;

/**
 * @author Administrator
 *
 */
@Data
public class Result<T> {
	
	private	String code;
	
	private String msg;
	
	private T data;
	
	public Result<T> result(String code,String msg){
		Result<T> teResult = new Result<>();
		this.code = code;
		this.msg = msg;
		return teResult;
	}
	
	public Result<T> result(String code,String msg,T data){
		Result<T> teResult = new Result<>();
		this.code = code;
		this.msg = msg;
		this.data = data;
		return teResult;
	}
	
	public static void main(String[] args) {
		Result re = new Result<>();
		User result =null;
		List<User> list = new ArrayList<>();
		for (int i = 0; i < 3; i++) {
			result = new User();
			result.setId(i+"");
			result.setUserName(i+"试试吗 万一。。。。。。。。。。");
			list.add(result);
		}
		re.result("0000", "处理成功",list);
		System.out.println(re);
	}
}
